0:00:00
?
Human
Player black
?
   
?

BM
   
BK

Unfortunately, your browser does not support the canvas element.


0:00:00
?
Human
Player white
?
   
?

WM
   
WK

    wHub: web interface for Scan home


INTRO


This program is a user interface for playing the game of draughts (International 10x10). You can:
  • Play a game against yourself.
  • Play a game against a draughts engine.
  • Let a draughts engine play against itself.

This interface is especially designed to control the draughts engine Scan by Fabien Letouzey. But other draughts engines that support the hub-protocol can also be used.
The draughts engine can be located on your computer or can be located anywhere on your network.

Get acquainted with the application and navigate through the sections by pressing the buttons at the left.
The main sections to play a game are:
- Game request section: setup the initial position.
- Game play section: control playing the game.

For general help, see the last section.
For help to setup a draughts engine, click on the titles below.


1. Setup the draughts engine.
How can we make the draughts engine ready for use?
We give a description how to do this locally on one computer.
I expect this works for Windows, macOS and Linux.

First of all you have to install two programs.
1. Install Scan (or other draughts engine) on your computer. See the docs of Scan how to do this.

2. Install the program "websocketd".
Go to the website: WebSocket daemon .
Always be critical to download software. Read the website and be convinced this software can be trusted. Download the software, extract files and put these in the folder of your choice. The main file is an executable named "websocketd" or for Windows "websocketd.exe".

Now we must start Scan in a special way as described on the website of websocketd.
As an example I show you how I start Scan.
The command I run on my Linux distribution:
    ./websocketd    --port=27532    ./scan hub
To keep it simple I put the websocktd executable in the same folder as the Scan executable. Create a shortcut of this command if you like it.
You can use an other port number but 27532 is the default port of this user interface.



2. Start the draughts engine.
If the websocktd program is successfully started with Scan, you are ready to use it. Go to the Engine control section of the interface. Press the button Connect.
Verify that the port number is the same as used before.
I use for the host name localhost, because in my case websocketd and the user interface are on the same computer.
See the log text to verify that Scan is successfully connected.

After Scan is connected, press the button Init engine. Look at the log text for the progress of the initialization. If the last command received is "ready", you can use the user interface to control the engine and play a game.



3. Use the draughts engine.
Usage scheme 1: the engine as advisor.
  1. Start the application.
  2. Connect the engine and init the engine for use.
  3. Go to the Game play section.
  4. Press GO to start a human-human game.
  5. Do a move by clicking on squares of the board.
  6. Repeat moving for both black and white player.
  7. Press Ask hint and wait for the answer of the engine.
  8. After a while, the best move is shown.

Usage scheme 2: the engine as player.
  1. Start the application.
  2. Connect the engine and init the engine for use.
  3. Go to the Game request section.
  4. Select the black player to be an engine.
  5. Press NEW GAME. This leads you to the Game play section.
  6. Press GO to start a human-engine game.
  7. As human white player do a move by clicking on squares of the board.
  8. Now it is the turn for the engine. Wait until the engine does a move.
  9. Repeat.



About wHub
© Copyright 2018: Arthur Kalverboer

Change log:
  1. 02 sep 2018: version 2018.09.02
    Initial release.
  2. 20 sep 2018: version 2018.09.20
    Save game request data on local storage. New button to save current state of a game as new game request.



ENGINE CONTROL


Host Port

... 

Set engine parameters
Variant
Book

Book-ply default
Book-margin default
threads default
tt-size default
bb-size default


... 

Initialization log


GAME REQUEST


Event:

Setup selected piece
by point and click:


Player to start:
?

?

?

?

?
20

20

20

20

 
?
?

Setup by entering a FEN string:


White
Black

Playing Level white
Playing Level black
Clock usage sec

... 



PLAY A GAME


  Pause after move:

  ...



  plies back

  ... 

  ... 

  Result:  



Display:
...

  Save current state as new game request


MESSAGE LOG


Receive log



Send log



Minimax log


HELP


The user interface consists of sections. You can make them visible by pressing the buttons left.
A obvious order to use sections is:
  1. Use the game request section to setup a new game.
  2. Use the play section to play a game.
  3. If you like to use an engine, go to the engine control section to initialize the engine.



1. Game request.
This section is used for setting up preliminary conditions for a new game. These conditions are:
  • Event of the game.
  • Starting position.
  • Player to move first: white or black.
  • The name of the white/black player.
  • The role of the white/black player: human or engine.
  • Playing level for the engine player: time per move, remaining time or max depth.
  • Clock usage: count up or count down with initial start time.
You can setup a position with the mouse by point and click.
Or you can use a FEN string to setup a position.

If the role of a player is human, the user does the moves by point and click on the board. If the role is engine, a connection with Scan must be established.
The application is equipped with two special build-in engines.
- a random player for the sake of fun.
- a minimax player: weaker than Scan but not very stupid.
Human-human, human-engine or engine-engine games are possible. In case of an engine-engine game, one engine plays against itself. So only one connection to an engine is needed.

If you are ready to setup the game conditions, push the button NEW GAME. It will automatically lead you to the play section.

The settings of a game request are saved as local storage. If you start a new session the stored game request is retrieved.


2. Game play.
The first time you enter this section, the game is in a PAUSED state. Push the GO button to start playing.
If a human player has the turn, do a move by point and click.
If a engine player has the turn, wait until the engine answers with a move.
To give the user some time to contemplate the game, a pause facility can temporary stop the game until the user presses a continue button.
Options to pause:
  • Never: never pause.
  • Once: pause after the next move.
  • Always: pause after each move.
  • White moves: pause after each white move.
  • Black moves: pause after each black move.
  • Engine moves: pause after each engine move.
  • Delay 1 sec: after each move pause 1 second.
  • Delay 3 sec: after each move pause 3 seconds.

The user can ask to move back some number of plies (half moves). The move back is only possible if a human player has the turn or the game is in a PAUSE state. So it not possible to move back during the time an engine player is thinking.

The user can ask the engine for a hint. The engine returns the best move. To ask for a hint, the engine must be ready for use. Asking for a hint is not possible if an engine player is already thinking for the next move.

If an engine is thinking for the next move, you can ask the engine to move now. The engine interrupts the searching for a best move and gives the best move so far.

A button is provided to save the current state of the game as a new game request. This makes it possible to change the game while playing. For example you play a human-human game and continue with a human-engine game.

During a game, various info about the game is shown. You can choose to show a game log, the current PDN and FEN, general game info and info about an engine move (PV).
The legends on top and bottom of the board show info about player to move, name of the players, role of the players, number of pieces and the elapsed thinking time. The clock is only informative and can be set to count up or count down.


3. Engine control.
If a player of a game is the engine or you want to ask the engine for a hint, you must initialize the engine. First open a connection to the engine and then start the initialization phase.

Before the initialization phase, you can set some parameters for the engine. A parameter "book" can be set for using an opening book. The parameter "variant" has three options: "Normal", "Killer" or "Breakthrough". Keep your eyes on the initialization log to check a successfull initialization.

If the last message received is "ready", the engine indicates it is ready to play draughts. Go to the Game request section to setup a game.
Both players can have the role of an engine, but only one draughts engine can be connected.
All engine messages send and received are logged in the Message log section.



4. Message log.
The message log section show all messages send to and received from the engine.
The minimax engine reports in a separate log box.





C0 C1 C2 C3 C9 C7